﻿namespace OasisCiq.Xpil
{
    using System;
    using System.Linq;

    /// <summary>
    /// List of information types used for describing a qualification
    /// </summary>
    public class QualificationElementList : XS.XSNormalizedString
    {
        private static readonly string[] PossibleValues = new[] 
        {
            "QualificationName", // Free text name of the qualification
            "MajorSubject", // Name of the major subject of the qualification
            "MinorSubject", // Name of a minor subject of the qualification
            "Grade", // Grade (average?, percentage? ) achieved with the qualification.
            "CourseDuration", // Free text description of the duration of the course, e.g. 4 years, 1 month, etc.
            "CompletionDate", // Free text description of the date when the qualification was completed to the best known precision.
            "Award", // Award, or distinction that was awarded to the graduate, e.g. honors.
            "Restriction", // Restrictions imposed on the graduate, e.g. not valid before completion of 2 year practical work under supervision.
            "Registration", // Details of any professional registration if required for practicing, e.g. for pharmacists, electricians, medical professionals.
            "WayOfStudy" // Full time, part time, evening classes, extramural, etc.
        };

        public QualificationElementList(string value)
            : base(value)
        {
            if (!PossibleValues.Contains(value))
            {
                throw new ArgumentOutOfRangeException();
            }
        }
    }
}